from django.shortcuts import get_object_or_404

from shortMessage.models import DailyNews


def generate_daily_news():
    daily_news_list = DailyNews.objects.all().order_by('-created_time')
    return daily_news_list


def increase_like_pk(pk):
    news = get_object_or_404(DailyNews, pk=pk)
    news.increase_like()
    return news.like_cnt
